<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const obj = {
        firstName: "li",
        lastName: "jack",
        get fullName() {
          return `${this.firstName} ${this.lastName}`;
        },
        set fullName(value) {
          const arr = value.split(" ");
          [this.firstName, this.lastName] = arr;
          // this.firstName = arr[0];
          // this.lastName = arr[1];
        },
      };

      console.log(obj.fullName);
      obj.fullName = "zhang lili";
      console.log(obj.fullName);
    </script>
  </body>
</html>
